/*
 * ===================================================
 *
 *       Filename:  main.c
 *
 *
 *        Created:  10/12/2011 07:25:02 PM
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  durand_y, <durand.yoan@gmail.com>
 *
 * ===================================================
 */
#include "malloc.h"
#include <stdio.h>


int     main()
{
    char    *test   = NULL;
    char    *toto   = NULL;
    char    *t = NULL;
    char    *m = NULL;
    int i = 0;
    test = malloc (5);
    test[0] = 't';
    test[1] = 'e';
    test[2] = 's';
    test[3] = 't';
    test[4] = '\0';
    toto = malloc(sizeof(char) * 13);
    for (i = 0; i < 12; i++)
         toto[i] = (i + '0');
    toto[12] = '\0';
    t = malloc(28);
    for (i = 0; i < 27; i++)
        t[i] = (i + '0');
    t[i] = '\0';
    char *s = NULL;
    s =malloc(15);
    for (i = 0; i < 14; i++)
         s[i] = (i + '0');
    s[i] = '\0';
    char *s1 = NULL;

    s1 = malloc(56);
       for (i = 0; i < 55; i++)
       {
            s1[i] = i + '!';
       }
       s1[i] = '\0';
    free (toto);
    free (s);
    toto = NULL;
    s = NULL;
    for (i = 1; i < 100; i++)
    {
      m =malloc(i);
        my_show_mem();
        write(STDOUT_FILENO, "========================\n", 25);
      for (int j = 0; j < (i-1); j++)
        m[j] = (j + '!') % 255;
      m[i-1] = '\0';
    }
       return 0;
}

